import React, {Component} from 'react';
import {Image, StyleSheet, Text, View} from 'react-native';
import {Flex, WingBlank} from '@ant-design/react-native';

class ZsCard extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <Flex style={styles.flex}>
                <Flex>
                    <Image style={styles.image} source={require('~/assets/shouye/demo22x.png')} />
                </Flex>
                <Flex style={styles.itemtextview}>
                    <Flex style={styles.item} justify={'between'} align={'start'}>
                        <Text numberOfLines={1} style={styles.lowername}>
                            {this.props.item.BuildingName}
                        </Text>
                        <Text style={styles.money}>
                            {this.props.item.RentType == 0 ? (
                                <Text
                                    numberOfLines={1}
                                    style={{
                                        fontSize: 18,
                                        fontWeight: 'bold',
                                    }}>
                                    {this.props.item.PriceRent}元/月
                                </Text>
                            ) : (
                                <Text
                                    numberOfLines={1}
                                    style={{
                                        fontSize: 18,
                                        fontWeight: 'bold',
                                    }}>
                                    {this.props.item.PriceSell}元
                                </Text>
                            )}
                        </Text>
                    </Flex>
                    {/* <Flex style={styles.item}>
                            <Text style={styles.text}>{this.props.item.ParkingName}</Text>
                        </Flex> */}
                    <Flex direction={'row'} style={{width: '100%', marginBottom: 20}}>
                        <View style={{marginTop: 9}}>
                            <Image
                                style={{
                                    width: 10,
                                    height: 11,
                                }}
                                source={require('~/assets/shouye/dizhi_12x.png')}
                            />
                        </View>
                        <Text numberOfLines={1} style={styles.text}>
                            {this.props.item.CityName} {this.props.item.BuildingAddress}
                        </Text>
                    </Flex>
                    <Flex style={styles.item}>
                        {this.props.item.RentType == 0 ? <Text style={styles.biaoqian}>出租</Text> : <Text style={styles.biaoqians}>出售</Text>}
                    </Flex>
                </Flex>
            </Flex>
        );
    }
}

export default ZsCard;

const styles = StyleSheet.create({
    flex: {
        backgroundColor: 'white',
        height: 125,
        marginTop: 10,
        borderRadius: 5,
    },
    image: {
        width: 105,
        height: 105,
        margin: 10,
    },
    itemtextview: {
        width: '65%',
        flexDirection: 'column',
        marginLeft: 7,
    },
    item: {
        width: '100%',
    },
    lowername: {
        fontSize: 15,
        color: '#333333',
        fontWeight: 'bold',
        marginTop: 18,
    },
    text: {
        fontSize: 12,
        color: '#666666',
        marginTop: 9,
    },

    biaoqian: {
        width: 70,
        height: 27,
        lineHeight: 27,
        fontSize: 14,
        borderRadius: 2,
        overflow: 'hidden',
        backgroundColor: '#E67817',
        color: '#FFFFFF',
        marginBottom: 15,
        justifyContent: 'center',
        alignItems: 'center',
        textAlignVertical: 'center',
        textAlign: 'center',
    },
    biaoqians: {
        width: 70,
        height: 27,
        lineHeight: 27,
        fontSize: 14,
        borderRadius: 2,
        overflow: 'hidden',
        textAlign: 'center',
        paddingTop: 2,
        backgroundColor: '#E94F4F',
        color: '#FFFFFF',
        marginBottom: 25,
        justifyContent: 'center',
        alignItems: 'center',
        textAlignVertical: 'center',
    },
    money: {
        width: '50%',
        marginTop: 14,
        fontSize: 14,
        paddingLeft: 15,
        color: '#EB5A31',
        marginBottom: 15,
    },
});
